package com.chenyaowei.order.service;

import com.chenyaowei.order.domain.CywOrder;
import com.chenyaowei.order.vo.MonthTurnoverVO;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 订单Service接口
 *
 * @author 陈耀威
 * @date 2023-12-03
 */
public interface ICywOrderService
{
    /**
     * 查询订单
     *
     * @param id 订单主键
     * @return 订单
     */
    public CywOrder selectCywOrderById(Long id);

    /**
     * 查询订单列表
     *
     * @param cywOrder 订单
     * @return 订单集合
     */
    public List<CywOrder> selectCywOrderList(CywOrder cywOrder);

    /**
     * 新增订单
     *
     * @param cywOrder 订单
     * @return 结果
     */
    public int insertCywOrder(CywOrder cywOrder);

    /**
     * 修改订单
     *
     * @param cywOrder 订单
     * @return 结果
     */
    public int updateCywOrder(CywOrder cywOrder);

    /**
     * 批量删除订单
     *
     * @param ids 需要删除的订单主键集合
     * @return 结果
     */
    public int deleteCywOrderByIds(Long[] ids);

    /**
     * 删除订单信息
     *
     * @param id 订单主键
     * @return 结果
     */
    public int deleteCywOrderById(Long id);

    CywOrder selectOrderByOrderSn(String orderSn);

    int updateOrderStatus(String orderSn, Integer code);

    List<CywOrder> selectListForFront(CywOrder cywOrder);

    int cancelOrder(String orderSn, Integer status);

    List<CywOrder> selectTimeOutOrderList();

    void handlePayResult(String orderSn);

    List<MonthTurnoverVO>  monthTurnoverSum(Date yearStart, Date yearEnd);

    BigDecimal totalTurnoverSum(Date todayStart, Date todayEnd);
}
